<?php
/**
 * 热门小区
 */

namespace app\api\controller;


use app\api\model\HotVallige as HotValligeModel;
use app\common\controller\ApiController;
use think\Exception;

class HotVallige extends ApiController {

//    protected $notNeedToken = ['gethotsearch'];

    protected $notNeedPhone = ['gethotsearch'];

    protected $isArrayResult = ['gethotsearch'];

    /**
     * 热门搜索
     * @return false|string
     */
    public function getHotSearch() {
        try {
            $params = $this->checkParams('');
            if ($params === false) {
                return $this->resErr();
            }
            $headers=$this->headers;
            $city_code=$headers['adcode'];
            $HotValligeModel = new HotValligeModel();
            $data = $HotValligeModel->getHotSearch($params,$city_code);
            return $this->resData('success', $data);
        } catch (Exception $e) {
            return $this->resErr($e->getMessage(), $e->getCode());
        }
    }

}
